//
//  JourneyDetailView.m
//  WildDonkey
//
//  Created by 孙俊 on 15/4/1.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "JourneyDetailView.h"

@interface JourneyDetailView()

@property (nonatomic,retain) UIWebView *webView;

@end

@implementation JourneyDetailView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc
{
	[_webView release];
	[super  dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
	self = [super initWithFrame:frame];
	if (self) {
		
		CGRect rect  = [UIScreen mainScreen].bounds;
		CGFloat Width = rect.size.width;
		CGFloat height = rect.size.height;
		
		UIView *bgView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
		
		_webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 100, Width, height)];
		
		[self.webView loadHTMLString:self.content baseURL:nil];
		
		[bgView addSubview:self.webView];
		
		[bgView release];
		bgView = nil;
	}
	return self;
}

- (void)setData:(JourneyDetailData *)data
{
	if (_data != data) {
		[_data release];
		_data = [data retain];
		
		self.content = data.content;

	}
}

@end
